<%@page import="java.util.Calendar,java.text.SimpleDateFormat,java.text.DateFormat,com.crm.entity.Opportunity,java.util.List" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>ASCRM</title>
<link href="<%=application.getContextPath()%>/css/css-crm.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-1.7.2.min.js"></script>
<script language="javaScript" src="<%=application.getContextPath()%>/js/jquery-ui-1.8.20.custom.min.js"></script>
<script type="text/javascript" src="<%=application.getContextPath()%>/js/jquery-ui-1.8.17.custom.min.js"></script>	
<link rel="stylesheet" href="<%=application.getContextPath()%>/css/jquery-ui-1.8.17.custom.css"/>
<link rel="stylesheet" href="<%=application.getContextPath()%>/css/datatable.css"/>
<script type="text/javascript" language="javascript" src="<%=application.getContextPath()%>/js/jquery.dataTables.js"></script>
<script language="javascript" type="text/javascript" src="<%=application.getContextPath()%>/js/tablefilter.js"></script>

<script type="text/javascript" charset="utf-8">
	$(document).ready(function() {
		$('#myDataTable').dataTable();
	} );
</script>
</head>

<body>
<div id="main">
  <%@include file="common/header.jsp" %>
  <%@include file="common/submenu.jsp" %>
  
  <div id="content">
    <div id="work-area">
      <div class="heading">Search Enquiry</div>
	  
      <div class="box2">
        <form method="post" action="<%=application.getContextPath()%>/enqSearch/search.do">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td align="right">&nbsp;</td>
              <td align="right">&nbsp;</td>
              <td align="right" valign="middle">&nbsp;</td>
              <td align="right" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
            </tr>
            <tr>
             <%
    	Calendar currentDate = Calendar.getInstance();
		DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
		String dateNow = formater.format(currentDate.getTime());
        String datearr[]=dateNow.split("-");
        %>
              <td width="14%" align="right"><strong>Search By</strong></td>
              <td width="11%" align="right">Month &nbsp; </td>
              <td width="23%" align="right" valign="middle"><label>
              <select name="month" class="form" id="select">
              <option value="01" <%if(datearr[1].equals("01")){ %>selected="selected"  <%} %> >Jan</option>
                <option value="02" <%if(datearr[1].equals("02")){ %>selected="selected"  <%} %> >Feb</option>
                <option value="03" <%if(datearr[1].equals("03")){ %>selected="selected"  <%} %>  >Mar</option>
                <option value="04" <%if(datearr[1].equals("04")){ %>selected="selected"  <%} %>  >Apr</option>
                <option value="05" <%if(datearr[1].equals("05")){ %>selected="selected"  <%} %>  >May</option>
                <option value="06" <%if(datearr[1].equals("06")){ %>selected="selected"  <%} %> >Jun</option>
                <option value="07" <%if(datearr[1].equals("07")){ %>selected="selected"  <%} %>  >Jul</option>
                <option value="08" <%if(datearr[1].equals("08")){ %>selected="selected"  <%} %>  >Aug</option>
                <option value="09" <%if(datearr[1].equals("09")){ %>selected="selected"  <%} %>  >Sep</option>
                <option value="10" <%if(datearr[1].equals("10")){ %>selected="selected"  <%} %>  >Oct</option>
                <option value="11" <%if(datearr[1].equals("11")){ %>selected="selected"  <%} %>  >Nov</option>
                <option value="12" <%if(datearr[1].equals("12")){ %>selected="selected"  <%} %>  >Dec</option>
                </select>
              </label>              </td>
              <td width="6%" align="right" valign="middle">year &nbsp; </td>
              <td width="22%" align="left" valign="middle">
              <select name="year" class="form" id="select2">
              <option value="2012" <%if(datearr[0].equals("2012")){ %>selected="selected"  <%} %> >2012</option>
                <option value="2013" <%if(datearr[0].equals("2013")){ %>selected="selected"  <%} %>  >2013</option>
                <option value="2014"<%if(datearr[0].equals("2014")){ %>selected="selected"  <%} %>  >2014</option>
                <option value="2015" <%if(datearr[0].equals("2015")){ %>selected="selected"  <%} %>  >2015</option>
                <option value="2016" <%if(datearr[0].equals("2016")){ %>selected="selected"  <%} %>  >2016</option>
                <option value="2017"<%if(datearr[0].equals("2017")){ %>selected="selected"  <%} %>  >2017</option>
                <option value="2018"<%if(datearr[0].equals("2018")){ %>selected="selected"  <%} %>  >2018</option>
                <option value="2019"<%if(datearr[0].equals("2019")){ %>selected="selected"  <%} %>  >2019</option>
                <option value="2020"<%if(datearr[0].equals("2020")){ %>selected="selected"  <%} %>  >2020</option>
                <option value="2021"<%if(datearr[0].equals("2021")){ %>selected="selected"  <%} %>  >2021</option>
                <option value="2022"<%if(datearr[0].equals("2022")){ %>selected="selected"  <%} %>  >2022</option>
                <option value="2023"<%if(datearr[0].equals("2023")){ %>selected="selected"  <%} %>  >2023</option>
                <option value="2024"<%if(datearr[0].equals("2024")){ %>selected="selected"  <%} %> >2024</option>
              <option value="2025"<%if(datearr[0].equals("2025")){ %>selected="selected"  <%} %> >2025</option>
              </select>              </td>
              <td width="12%" align="left" valign="middle">
              <input type="submit" class="button" value="Search"/></td>
              <td width="12%" align="left" valign="middle">&nbsp;</td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td align="right">&nbsp;</td>
              <td align="right" valign="top">&nbsp;</td>
              <td align="left" valign="middle">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
            </tr>
            <tr>
              <td align="right">&nbsp;</td>
              <td align="right">&nbsp;</td>
              <td colspan="3" align="center" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="48%">&nbsp;</td>
                  <td width="52%">&nbsp;</td>
                </tr>
              </table></td>
              <td align="left" valign="top">&nbsp;</td>
              <td align="left" valign="top">&nbsp;</td>
            </tr>
          </table>
          </form>
      </div>
	  
	  <div class="box2">
	  <div id="demo">
	 	<table  id="myDataTable" width="100%" cellpadding="4" cellspacing="1" bgcolor="#C5E4EB">
          <thead>
          <tr>
            <th width="36" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"  style="background-repeat:repeat-x">S.No </th>
            <th width="138" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Reference Number</th>
            <th width="140" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF"> Enquiry Number</th>
            <th width="162" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"  style="background-repeat:repeat-x bgcolor="#FFFFFF">Client</th>
            <th width="186" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Division</th>
            <th width="186" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Due Date</th>
            <th width="186" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Recieved Date</th>
            <th width="186" align="center" valign="middle" background="<%=application.getContextPath()%>/images/table-box.jpg"   style="background-repeat:repeat-xbgcolor="#FFFFFF">Status</th>
          </tr>
          </thead>
          <tbody>
          <%
          	if(request.getAttribute("oppList")!=null){
          		List<Opportunity> lopp=(List<Opportunity>)request.getAttribute("oppList");
          		//assert false:lopp;
          		for(int i=0;i<lopp.size();i++){
          %>
          <tr>
            <td align="center" bgcolor="#FFFFFF"><input name="textfield25" type="text" size="5" value="<%=i+1%>"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF" ><a href="<%=application.getContextPath() %>/editEnq/setSrchEnq.do?refNo=<%=lopp.get(i).getRefNum()%>"><input name="textfield252" type="text" size="5" value="<%=lopp.get(i).getRefNum()%>"/></a></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="textfield253" type="text" size="5" value="<%=lopp.get(i).getEnqnum()%>"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="textfield254" type="text" size="5" value="<%=lopp.get(i).getOrganisation()%>"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="textfield255" type="text" size="5" value="<%=lopp.get(i).getDivision()%>"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="textfield256" type="text" size="5" value="<%=lopp.get(i).getDuedate()%>"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="textfield257" type="text" size="5" value="<%=lopp.get(i).getCurr_date()%>"/></td>
            <td align="left" valign="top" bgcolor="#FFFFFF"><input name="textfield257" type="text" size="5" value="<%=lopp.get(i).getStatus()%>"/></td>
          </tr>
          <%
      	
          		}
          	}
          %>
          </tbody>
        </table>
      </div>
	 <!--  <div class="box2">
	    <div class="buttton-main">
	    	<div class="button">Close</div>
	    	<div class="button">Show</div></div>
	  </div> -->
	  
    </div>
    </div>
    
	</div><div id="footer"></div>  
</div>
</body>
</html>
